package com.ctgu.server.mapper;

import com.ctgu.server.dao.entity.GroupUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ctgu
 * @since 2023-05-30
 */
@Mapper
public interface GroupUserMapper extends BaseMapper<GroupUser> {
    @Select("<script>" +
            "select distinct (user_id) from group_user where group_id in " +
            "<foreach item='item' collection='groupIdList' open='(' separator=',' close=')'>" +
            "#{item}" +
            "</foreach>" +
            "</script>")
    List<String> selectUserToAtt(List<String> groupIdList);
}
